<?php
namespace Work\Controller;


use Think\Controller;

class MessageController extends Controller{
    /*
     * 留言板后台展示
     * */
    public function message(){
        $id = $_SESSION['cp_id'];
        $message = D('message');
        $page   = isset($_GET['page']) ? $_GET['page'] : 1;
        $count  = $message->count();
        $number = (int)($count/3)+1;
        $this->assign('number', $number);
        $data = $message->where(['s_id'=>'$id'])->limit(($page-1)*3,3)->select();
        $this->assign('page',$page);
        $this->assign('data',$data);
        $this->display('message');
    }




}